﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Media.Media3D;

namespace Grafika_WPF.Components
{
    public class Triangle
    {
        public Point3D A { get; set; }
        public Point3D B { get; set; }
        public Point3D C { get; set; }
        public Color Color { get; set; }
        public Point3D[] Points { get; set; }
        public Vector3D GetNormalVector()
        {
            var aB = A - B;
            var aC = A - C;
            var normal = Vector3D.CrossProduct(aB, aC);
            normal.Normalize();
            return normal;
        }
        public Triangle()
        {
            Points = new Point3D[]
                       {
                           A,B,C
                       };
        }

        public bool IsDegenerated
        {
            get
            {
                return A == B || B == C || C == A;
            }
        }

    }
}
